package PhamVanHien;

import java.util.Scanner;

public class PTBac2 {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		double a, b, c, x1, x2;
		System.out.println("Nhap vao a: ");
		a = sc.nextDouble();
		System.out.println("Nhap vao b: ");
		b = sc.nextDouble();
		System.out.println("Nhap vao c: ");
		c = sc.nextDouble();
		double delta = b*b - 4*a*c;
		if((a==0)&&(b==0)&&(c==0)){
			System.out.println("Pt co vo so nghiem!");
		}
		if((a==0)&&(b==0)){
			System.out.println("PT vo nghiem!");
		}
		if(a!=0){
			if(delta<0){
				System.out.println("Pt vo nghiem");
			}
			else if(delta==0){
				System.out.println("Pt co nghiem kep x1 = x2 = "+(-b/(2*a)));
			}
			else{
				System.out.println("Pt co hai nghiem\n");
				System.out.println("x1 = "+((-b + Math.sqrt(delta))/(2*a)));
				System.out.println("x2 = "+((-b - Math.sqrt(delta))/(2*a)));
			}
		}
	}

}
